package com.etcbase.dcs.model.map;

import java.util.Calendar;
import java.util.Locale;

import com.google.android.maps.GeoPoint;

public class MapNote {

	private long id = 0;
	private String userName;
	private String name;
	private String note;
	private String city;
	private String district;
	private String address;
	private String latitude;
	private String longitude;
	private String editDate;

	@Override
	public String toString() {
		return "[name=" + name + ", note=" + note + ", city=" + city
				+ ", district=" + district + ", latitude=" + latitude
				+ ", longitude=" + longitude + "]";
	}

	public long getID() {
		return id;
	}

	public void setID(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getDistrict() {
		return district;
	}

	public void setDistrict(String district) {
		this.district = district;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getEditDate() {
		return editDate;
	}

	public void setEditDate(String editDate) {
		this.editDate = editDate;
	}

	public void setEditDate(Calendar calendar) {
		editDate = ""
				+ calendar.get(Calendar.DAY_OF_MONTH)
				+ " "
				+ calendar.getDisplayName(Calendar.MONTH, Calendar.SHORT,
						Locale.getDefault()) + " "
				+ calendar.get(Calendar.YEAR);
	}

	public GeoPoint getGeoPoint() {
		double lat = Double.parseDouble(latitude);
		double lng = Double.parseDouble(longitude);
		return new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6));
	}

	public void setLatLong(GeoPoint p) {
		latitude = "" + (p.getLatitudeE6() / 1E6);
		longitude = "" + (p.getLongitudeE6() / 1E6);
	}
}
